<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * Function for controlling that a user is loged in.
 * The function redirects the user to the login page if not loged in.
 *
 * @param void
 * @return void
 */
if ( ! function_exists('user_authorization'))
{
	function user_authorization()
	{
		//Getting the CodeIgniter super object so the session class can be used.
		$ci = & get_instance();
		
		//Getting information about if the user is loged in.
		$loged_in = $ci->session->userdata('user_loged_in');
		
		//Redirecting the user to login page if not loged in.
		if (!$loged_in) {
			redirect('c_logon');
		}
	}
}

/* End of file MY_security_helper.php */
/* Location: ./application/helpers/MY_security_helper.php */